package src.main.shengchengqi;

//定义产品类
public class Product
{
    Unit1 unit1;
    Unit2 unit2;
    Unit3 unit3;

    public Unit1 getUnit1() {
        return unit1;
    }

    public void setUnit1(Unit1 unit1) {
        this.unit1 = unit1;
    }

    public Unit2 getUnit2() {
        return unit2;
    }

    public void setUnit2(Unit2 unit2) {
        this.unit2 = unit2;
    }

    public Unit3 getUnit3() {
        return unit3;
    }

    public void setUnit3(Unit3 unit3) {
        this.unit3 = unit3;
    }

    @Override
    public String toString() {
        return "Product{" +
                "u1=" + unit1.getU1()+
                ", u2=" + unit2.getU2() +
                ", u3=" + unit3.getU3() +
                '}';
    }
}
//产品的各个组件
class Unit1{private String u1;

    public String getU1() {
        return u1;
    }

    public void setU1(String u1) {
        this.u1 = u1;
    }
}
class Unit2{private String u2;

    public String getU2() {
        return u2;
    }

    public void setU2(String u2) {
        this.u2 = u2;
    }
}
class Unit3{private String u3;

    public String getU3() {
        return u3;
    }

    public void setU3(String u3) {
        this.u3 = u3;
    }
}
